-- bine_recovery
-- create by cheny3
-- 治疗魔藤

return {
    -- 判断
    canTrigger = function(args)
        local bine = ME.user.bine;
        if not bine then
            return;
        end

        local classId = bine.classId;
        if BineM.query(classId, "alias") ~= "magic_bine" then
            -- 不是魔藤
            return false;
        end

        -- 判断是否小于限制的血量
        local percent = args["hp_percent"];
        local maxHp = bine:getMaxHp();
        local curHp = bine:getHp();
        if curHp * 100 < maxHp * percent then
            return BineM.canCure() == true;
        end

        return false;
    end,

    -- 触发
    trigger = function(args)
        -- 治疗魔藤
        return DungeonActionM.go('bine_cure');
    end,
};
